/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.server.database;

import com.core.log.Debug;
import com.core.utils.Utils;
import java.sql.Timestamp;

/**
 *
 * @author daz
 */
public class UserInfo {
    
    private String userName;
    private String userPassword;
    private long userId;
    private int isPlay;
    private int gender;
    private long money;
    private int level;
    private int numberWin;
    private int numberLose;
    private int avatarId;
    private String status;
    private int isActivated;
    private int companyId;
    private String j2meLink;
    private int j2meVersionCode;
    private String j2meVersionName;
    private String androidLink;
    private int androidVersionCode;
    private String androidVersionName;
    private Timestamp lastLogin;
    private String adString;
    private String numberActivate;
    private String syntaxActivate;
    private Timestamp dateReg;
    private int numberLogin;
    
    public UserInfo() {
    }
    
    public Timestamp getDateReg() {
        return dateReg;
    }
    
    public void setDateReg(Timestamp dateReg) {
        this.dateReg = dateReg;
    }
    
    public void setSyntaxActivate(String syntaxActivate) {
        this.syntaxActivate = syntaxActivate;
    }
    
    public void setNumberLogin(int numberLogin) {
        this.numberLogin = numberLogin;
    }
    
    public int getNumberLogin() {
        return numberLogin;
    }
    
    public String getSyntaxActivate() {
        return syntaxActivate;
    }
    
    public void setNumberActivate(String numberActivate) {
        this.numberActivate = numberActivate;
    }
    
    public String getNumberActivate() {
        return numberActivate;
    }
    
    public void setMoney(long money) {
        Debug.info(userName + " update money :" + money);
        this.money = money;
    }
    
    public void setNumberWin(int number) {
        numberWin = number;
    }
    
    public void setNumbeLose(int number) {
        numberLose = number;
    }
    
    public void setStatus(String status) {
        this.status = status;
    }
    
    public void setLevel(int level) {
        this.level = level;
    }
    
    public void setLastLogin(Timestamp time) {
        this.lastLogin = time;
    }
    
    public int getNumberWin() {
        return this.numberWin;
    }
    
    public int getLevelComplete() {
        int currentLevel = Utils.fibonaci(level);
        int nextLevel = Utils.fibonaci(level + 1);
        if (nextLevel - currentLevel == 0) {
            return 0;
        }
        return (numberWin - currentLevel) * 100 / (nextLevel - currentLevel);
    }
    
    public int getNumberLose() {
        return this.numberLose;
    }
    
    public String getStatus() {
        return this.status;
    }
    
    public int getLevel() {
        return this.level;
    }
    
    public long getMoney() {
        return this.money;
    }
    
    public Timestamp getLastLogin() {
        return this.lastLogin;
    }
    
    public void setGender(int gender) {
        this.gender = gender;
    }
    
    public int getGender() {
        return this.gender;
    }
    
    public void setUserName(String name) {
        this.userName = name;
    }
    
    public void setUserPassword(String pass) {
        this.userPassword = pass;
    }
    
    public void setUserId(String id) {
        this.userId = Long.parseLong(id);
    }
    
    public void setIsplay(String isPlay) {
        this.isPlay = Integer.parseInt(isPlay);
    }
    
    public int getUserIsplay() {
        return this.isPlay;
    }
    
    public long getUserId() {
        return userId;
    }
    
    public String getUserPassword() {
        return userPassword;
    }
    
    public String getUserName() {
        return userName;
    }
    
    public void setAvatarId(int id) {
        this.avatarId = id;
    }
    
    public int getAvatarId() {
        return avatarId;
    }
    
    public void setActivated(int isActivated) {
//        Debug.d("set active :" + isActivated);
        this.isActivated = isActivated;
    }
    
    public int getActivated() {
//        Debug.d("get active :" + isActivated);
        return this.isActivated;
    }
    
    public void setCompanyId(int companyId) {
        this.companyId = companyId;
    }
    
    public int getCompanyId() {
        return companyId;
    }
    
    public void setJ2meLink(String j2meLink) {
        this.j2meLink = j2meLink;
    }
    
    public String getJ2meLink() {
        return j2meLink;
    }
    
    public void setJ2meVersionCode(int j2meVersionCode) {
        this.j2meVersionCode = j2meVersionCode;
    }
    
    public int getJ2meVersionCode() {
        return j2meVersionCode;
    }
    
    public void setJ2meVersionName(String j2meVersionName) {
        this.j2meVersionName = j2meVersionName;
    }
    
    public String getJ2meVersionName() {
        return j2meVersionName;
    }
    
    public void setAndroidLink(String androidLink) {
        this.androidLink = androidLink;
    }
    
    public String getAndroidLink() {
        return androidLink;
    }
    
    public void setAndroidVersionCode(int androidVersionCode) {
        this.androidVersionCode = androidVersionCode;
    }
    
    public String getAndroidVersionName() {
        return androidVersionName;
    }
    
    public void setAndroidVersionName(String androidVersionName) {
        this.androidVersionName = androidVersionName;
    }
    
    public int getAndroidVersionCode() {
        return androidVersionCode;
    }
    
    public String getAdString() {
        return adString;
    }
    
    public void setAdString(String adString) {
        this.adString = adString;
    }
}
